package digui;

import java.io.File;

public class RecursinTest5 {


    public  static  void main(String [] args){
        recursin("./",0);
    }

    public static  void recursin(String path,int level) {


        File file = new File(path);
        File [] files = file.listFiles();
        if(file==null || files.length == 0){
            return;
        }
        for(int i=0;i<level;i++){
            System.out.print("- ");
        }
        System.out.println(file.getName());
        for(int i=0;i<files.length;i++){
            if(files[i].isDirectory()){
                recursin(files[i].getAbsolutePath(),i+1);
            }else{
                System.out.println(files[i].getName());
            }
        }
    }

}
